package sqlTestes.tDDL;

import junit.framework.Assert;

import org.junit.Test;

import sql.ddl.Tabela;
import sql.ddl.coluna.Coluna;
import sql.dml.DDL;

public class TesteCriacaoDropTabela {
	@Test
	public void a() {
		Tabela agua = new Tabela("Agua");
		agua.addColuna(new Coluna("int4", "a", "NULL"));
		agua.addColuna(new Coluna("int4", "b", "NULL"));
		DDL obj = new DDL();
		Assert.assertEquals("CREATE TABLE Agua(a int4 NULL, b int4 NULL)", obj
				.create(agua));
	}

	@Test
	public void b() {
		Tabela agua = new Tabela("Agua");
		DDL obj = new DDL();
		Assert.assertEquals("DROP TABLE Agua", obj.drop(agua, false));
	}

	@Test
	public void c() {
		Tabela agua = new Tabela("Agua");
		DDL obj = new DDL();
		Assert.assertEquals("DROP TABLE Agua CASCADE", obj.drop(agua, true));
	}

}
